#ifndef __Thread_H__
#define __Thread_H__

#include <pthread.h>

namespace wd
{

class Thread
{
public:
    Thread()
    : _pthid(0)
    {}

    void start();//开启子线程的运行
    void join();

    static void * start_routine(void*);

    virtual ~Thread() {}
private:
    //交给派生类实现的任务
    virtual void run()=0;

private:
    pthread_t _pthid;
};

}//end of namespace wd

#endif

